﻿using UnityEngine;

namespace Doudizhu
{
    [CreateAssetMenu(fileName = "CardAssets", menuName = "Doudizhu/CardAssets")]
    public class CardAssets : ScriptableObject
    {
        [Header("花色")]
        public Sprite spade;    // 黑桃 ♠
        public Sprite heart;    // 红桃 ♥
        public Sprite club;     // 梅花 ♣
        public Sprite diamond;  // 方块 ♦

        [Header("大小王")]
        public Sprite joker_black;
        public Sprite joker_red;

        [Header("黑")]
        public Sprite black_three;
        public Sprite black_four;
        public Sprite black_five;
        public Sprite black_six;
        public Sprite black_seven;
        public Sprite black_eight;
        public Sprite black_nine;
        public Sprite black_ten;
        public Sprite black_jack;
        public Sprite black_queen;
        public Sprite black_king;
        public Sprite black_ace;
        public Sprite black_two;

        [Header("红")]
        public Sprite red_three;
        public Sprite red_four;
        public Sprite red_five;
        public Sprite red_six;
        public Sprite red_seven;
        public Sprite red_eight;
        public Sprite red_nine;
        public Sprite red_ten;
        public Sprite red_jack;
        public Sprite red_queen;
        public Sprite red_king;
        public Sprite red_ace;
        public Sprite red_two;

        public Sprite GetColorSprite(COLOR color)
        {
            switch (color)
            {
                case COLOR.spade: return spade;
                case COLOR.heart: return heart;
                case COLOR.club: return heart;
                case COLOR.diamond: return diamond;
                default: return null;
            }
        }

        public Sprite GetScoreSprite(COLOR color, SCORE score)
        {
            switch (color)
            {
                case COLOR.spade: 
                case COLOR.club:
                    switch (score)
                    {
                        case SCORE.three: return black_three;
                        case SCORE.four: return black_four;
                        case SCORE.five: return black_five;
                        case SCORE.six: return black_six;
                        case SCORE.seven: return black_seven;
                        case SCORE.eight: return black_eight;
                        case SCORE.nine: return black_nine;
                        case SCORE.ten: return black_ten;
                        case SCORE.jack: return black_jack;
                        case SCORE.queen: return black_queen;
                        case SCORE.king: return black_king;
                        case SCORE.ace: return black_ace;
                        case SCORE.two: return black_two;
                        case SCORE.joker_black: return joker_black;
                        case SCORE.joker_red: return joker_red;
                        default: return null;
                    }
                case COLOR.heart: 
                case COLOR.diamond:
                    switch (score)
                    {
                        case SCORE.three: return red_three;
                        case SCORE.four: return red_four;
                        case SCORE.five: return red_five;
                        case SCORE.six: return red_six;
                        case SCORE.seven: return red_seven;
                        case SCORE.eight: return red_eight;
                        case SCORE.nine: return red_nine;
                        case SCORE.ten: return red_ten;
                        case SCORE.jack: return red_jack;
                        case SCORE.queen: return red_queen;
                        case SCORE.king: return red_king;
                        case SCORE.ace: return red_ace;
                        case SCORE.two: return red_two;
                        case SCORE.joker_black: return joker_black;
                        case SCORE.joker_red: return joker_red;
                        default: return null;
                    }
                default: return null;
            }
        }
    }
}
